package com.stlm2.dems.user.entity.base;

import com.stlm2.dems.user.entity.IsValid;
import com.stlm2.dems.user.entity.PermissionType;

import java.io.Serializable;
import java.util.Date;

/**
 * Created by ZLQ on 2017/7/11.
 */
public class BaseSystemPrivilege implements Serializable {
    //主键
    private int id;
    //名称（中文简称）
    private String cnName;
    //权限名 \n命名规则如： user:update 表示用户功能中的修改按钮
    private String permissionName;
    //URL
    private String url;
    //资源类型1：URL 2：子菜单 3:按钮 4：父菜单
    private PermissionType permissionType;
    //是否有效
    private IsValid isValid;
    //创建时间
    private Date createTime;
    //固定权限
    private String permission;
    //父ID
    private  int superId;
    //说明
    private String explains;
    //序号
    private  int number;

    public int getNumber() {
        return number;
    }

    public void setNumber(int number) {
        this.number = number;
    }

    public String getExplains() {
        return explains;
    }

    public void setExplains(String explains) {
        this.explains = explains;
    }

    public int getSuperId() {
        return superId;
    }

    public void setSuperId(int superId) {
        this.superId = superId;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getCnName() {
        return cnName;
    }

    public void setCnName(String cnName) {
        this.cnName = cnName;
    }

    public String getPermissionName() {
        return permissionName;
    }

    public void setPermissionName(String permissionName) {
        this.permissionName = permissionName;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public PermissionType getPermissionType() {
        return permissionType;
    }

    public void setPermissionType(PermissionType permissionType) {
        this.permissionType = permissionType;
    }

    public IsValid getIsValid() {
        return isValid;
    }

    public void setIsValid(IsValid isValid) {
        this.isValid = isValid;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getPermission() {
        return permission;
    }

    public void setPermission(String permission) {
        this.permission = permission;
    }
    public Integer getIsValidValue() {
        return (isValid != null) ? isValid.getIntValue() : null;
    }

    public void setIsValidValue(Integer value) {
        if (value != null)
            this.isValid = IsValid.getByIntValue(value);
    }

    public Integer getPermissionTypeValue() {
        return (permissionType != null) ? permissionType.getIntValue() : null;
    }

    public void setPermissionTypeValue(Integer value) {
        if (value != null)
            this.permissionType = PermissionType.getByIntValue(value);
    }
}
